# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=belcard
pkgver=5.2.86
pkgrel=0
pkgdesc="C++ library to manipulate VCard standard format"
url="https://linphone.org/"
arch="all"
license="GPL-3.0-or-later"
options="!check" # not test available
makedepends="cmake bctoolbox-dev belr-dev samurai"
subpackages="$pkgname-dev $pkgname-libs"
source="$pkgname-$pkgver.tar.bz2::https://gitlab.linphone.org/BC/public/belcard/-/archive/$pkgver/belcard-$pkgver.tar.bz2"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake \
		-DCMAKE_INSTALL_DATADIR=share \
		-DENABLE_STRICT=NO \
		-DENABLE_SHARED=YES \
		-DENABLE_STATIC=NO \
		-DENABLE_UNIT_TESTS=NO
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

dev() {
	default_dev
	mkdir -p "$subpkgdir"/usr/lib/cmake/belcard
	mv "$pkgdir"/usr/share/belcard/cmake/* "$subpkgdir"/usr/lib/cmake/belcard
	rmdir -p "$pkgdir"/usr/share/belcard/cmake || true
}

sha512sums="
f3b10ddb5e6ff4350a057de9eb3d6b9a0a91ab593f5712e61b9a9be37db087ed37f98b5bb6aa70f1805e245c70e1b6bc0b977a48ca3a8c81195ba087c780f50e  belcard-5.2.86.tar.bz2
"
